<template>
    <el-container class="boxmain">
        <el-header>
            <Head :userinfo="userinfo"/>
        </el-header>
        <el-container class="boxsubmain">
            <el-aside width="200px" style="height:auto" >
                <Menu :userinfo="userinfo"/>
            </el-aside>
            <el-container>
                <el-main>
                    <router-view></router-view>
                </el-main>
                <el-footer>
                    <Foot/>
                </el-footer>
            </el-container>
        </el-container>
    </el-container>
</template>
<script>
import Head from "@/components/head.vue"
import Foot from "@/components/foot.vue"
import Menu from "@/components/sidemenu.vue"
import {getuserinfo} from "@/api"

export default {
    components:{
        Head,
        Foot,
        Menu
    },
    data(){
        return {
            userinfo:null,
        }
    },
    mounted(){
        getuserinfo()
        .then(res=>{
            if(res.type){
                this.userinfo = res.result;
                sessionStorage.setItem("roleid",res.result.roleid) // 记录当前的权限
                sessionStorage.setItem("username",res.result.username) 
            }
        })
    }
}
</script>


<style lang="scss">
.el-header{
    background: #23242C;
    height:50px !important;
}
.el-footer{
    background: #23242C;
    height:50px !important;

}

.el-aside{
    height: 100%;
    background: rgb(84, 92, 100);
}
.boxmain{
    width:100%;
    height:100%;
}
</style>
